<template>
  <div class="main">
    <div class="title">
      <span>人气推荐</span>
    </div>
    <div class="goods">
      <div class="Productdetails" v-for="hot in hotGoodsList" :key="hot.id" @click="getpopularity(hot.id)">
        <img :src="hot.list_pic_url" style="width:20%;height: 20%;">
        <div class="introduction">
          <span class="span1">{{hot.name}}</span>
          <span class="span2">{{hot.goods_brief}}</span>
          <span class="span3">￥{{hot.retail_price}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Popularrecommendation',
  props: ['hotGoodsList'],
  methods: {
    //点击跳转到商品详情页
    getpopularity(id) {
      this.$store.dispatch('getBranddetailsList', id)
      setTimeout(() => {
        this.$router.push({ name: 'productDetail', params: { id } })
      }, 500)
    }
  }
}
</script>

<style lang="less" scoped>
.main {
  margin-top: 5%;
  background-color: #fff;
  .title {
    padding-top: 7%;
    padding-bottom: 2%;
    display: flex;
    justify-content: center;
    span {
      font-size: 0.2rem;
    }
  }
  .goods {
    .Productdetails {
      margin-top: 2%;
      padding: 2% 3%;
      height: 20%;
      background-color: #f9f8f8;
      display: flex;
      .introduction {
        display: flex;
        flex-direction: column;
        margin-left: 4%;
        .span1 {
          font-size: 0.12rem;
        }
        .span2 {
          font-size: 0.12rem;
        }
        .span3 {
          margin-top: 15%;
          font-size: 0.16rem;
        }
      }
    }
  }
}
</style>